package com.wz.jiangsu.testnetvine;

import cn.hutool.core.bean.BeanUtil;
import lombok.Data;

import java.util.Map;

public class Main {
    public static void main(String[] args) {
        Person person = new Person();
        person.setName("John");

;
        // 使用Hutool的BeanUtil将对象转为Map
        Map<String, Object> map = BeanUtil.beanToMap(person);

        // 打印Map
        map.forEach((k,v)-> System.out.println(k + ":" + v));
    }
}

@Data
class Person{
    private String name;

    private Integer age;
}
